﻿@using ELTE.SEM.Data.ViewModels
@model RangeSelectorViewModel
<div class="selector-container" data-from="@Model.From" data-to="@Model.To" data-type="@Model.RangeType" data-selected="">
    <div class="range-selector-top-right-corner invisible"></div>

    @if (Model.Labels != null)
    {
        <input type="hidden" class="range-selector-values" value="@String.Join("#", Model.Labels)" />
    }

    @{ 
        var range = Enumerable.Range(Model.From, Model.To - Model.From + 1);
        foreach (int value in range)
        {
            string valueAsString = Model.RangeType == ELTE.SEM.Common.Enums.RangeSelectionType.Year ? value.ToString() : value.ToString("00");
            <div class="range-selector-value"  data-val="@valueAsString">
                @if (value.Equals(Model.Default))
                {
                    <div class="range-value range-default">
                        @valueAsString
                    </div>
                }
                else
                {
                    <div class="range-value">
                        @valueAsString
                    </div>
                }
                <div class="range-label" data-value="@value"></div>
            </div> 
        }}
</div>
